import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:pet/app/modules/login/controllers/login_controller.dart';

import '../controllers/fingerprint_controller.dart';

class FingerprintView extends GetView<FingerprintController> {
  const FingerprintView({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: GetBuilder<LoginController>(builder: (controller) {
          return Column(
            children: [
              const SizedBox(),
              const Expanded(
                child: Center(
                  child: Text(
                    '单击进行指纹登录\n\n双击跳转登录页面',
                    style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                  ),
                ),
              ),
              Expanded(
                child: Center(
                  child: GestureDetector(
                    onTap: () async {
                      await controller.fingerprintlogin();
                    },
                    onDoubleTap: () {
                      controller.toLoginPage();
                    },
                    child: const Icon(
                      Icons.fingerprint,
                      size: 60,
                    ),
                  ),
                ),
              ),
            ],
          );
        }),
      ),
    );
  }
}
